/* ----------------------------------------------------------------------------
* File: debug_logger_impl.cpp
*
* Desc: Debug logger stuffs
*
* Created: 21/06/2011, by Alexey Korshunov
* ---------------------------------------------------------------------------- */
#include "debug_logger_impl.h"
#include <stdarg.h>
#include <windows.h>

#define DEBUG_LOGGER_BUF_SIZE	2048


namespace Common
{
	DebugLogger::DebugLogger()
	{
	}

	DebugLogger::~DebugLogger()
	{
	}

	void DebugLogger::Print(const char* msg, ...)
	{
		char buf[2048];
		va_list ptr;

		va_start(ptr, msg);

		vsprintf(buf, msg, ptr);
		OutputDebugStringA(buf);

		va_end(ptr);
	}
}

namespace Common
{
	std::auto_ptr<Logger> CreateDebugLogger()
	{
		return std::auto_ptr<Logger>(new DebugLogger());
	}
}